﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FDFtpSync.Core
{
    public interface IContainer
    {
        IContainer Register(Action<IRegOptions> options);

        IContainer Build();

        T Resolve<T>();

        IList<T> ResolveAll<T>();

        IList<object> ResolveAll(Type type);

        object Resolve(Type type);
    }

    public interface IRegOptions
    {
        IRegOptions AddSingleton<TIn, TImpl>()
            where TIn : class
            where TImpl : class, TIn;

        IRegOptions AddSingleton(object obj);

        IRegOptions AddScoped<TIn, TImpl>()
            where TIn : class
            where TImpl : class, TIn;

        IRegOptions AddScoped(Type interType, Type implType);

        IRegOptions AddTransient<TIn, TImpl>()
            where TIn : class
            where TImpl : class, TIn;

        IRegOptions AddTransient(Type interType, Type implType);
    }
}
